#include "Shm.hpp"
#include <unistd.h>

int main()
{
    Shm shmfifo;
    shmfifo.buildShm();
    //sleep(3);
    shmfifo.attach();
    char* address = (char*)shmfifo.get_address();
    int size = shmfifo.getSize();
    while(true)
    {
        for(int i = 0; i < size; i++)
        {
            std::cout << address[i];
        }
        std::cout << std::endl;
        sleep(1);
    }

    sleep(20);
    shmfifo.detach();
    sleep(20);
    shmfifo.deleteShm();
    return 0;
}